﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Dialog.Master" AutoEventWireup="true"
    CodeBehind="RevenueMachineAccountConfirmation.aspx.cs" Inherits="NetDon.OA.Portal.Finance.RevenueMachineAccountConfirmation" %>

<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="NetDon.Utilities" %>
<%@ Register Src="../Controls/RequiredMark.ascx" TagName="RequiredMark" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <%@ register src="RevenueMachineAccountInfo.ascx" tagname="RevenueMachineAccountInfo"
        tagprefix="uc1" %>
    <script language="javascript" type="text/javascript">



        $(document).ready(function () {
            var dialog;
            if (window.top == window) {
                dialog = window;
            } else {

                dialog = window.top.Page.Dialog.find(function (item) {
                    return item._contentFrame.contentWindow == window;
                });

            }
            var fieldId = $get('<%=this.fieldIds.ClientID %>');


            var reloadButton = $get('<%=btnReLoadIds.ClientID %>');
            if (dialog && !reloadButton.disabled) {

                $text(fieldId, dialog._context.dialogArguments.Ids);
                reloadButton.click();


            }
        });

    </script>
    <style type="text/css">
        .ProductView td.ItemContent DIV
        {
            overflow: auto;
            width: auto;
            word-wrap: break-word;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td>
                <asp:TabContainer Style="margin-top: 10px;" ID="tabContainer" runat="server">
                    <asp:TabPanel runat="server" ID="tabPanel1">
                        <HeaderTemplate>
                            <asp:Literal ID="Literal2" runat="server" Text="对账确认"></asp:Literal>
                        </HeaderTemplate>
                        <ContentTemplate>
                            <NetDon:FormPanel ID="FormPanelStatementOfAccount" runat="server" CaptionAlign="NotSet" SkinID="ProductView"
                                RepeatColumns="2">
                                <Items>
                                    <NetDon:FormItem FullRow="True" HeaderVisible="False" ContentStyle-Font-Bold="true" >
                                        <ContentTemplate>
                                            <asp:Literal ID="Literal4" runat="server" Text="基本信息"></asp:Literal>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                    <NetDon:FormItem HeaderText="订单编号">
                                        <ContentTemplate>
                                            <asp:Label runat="server" ID="txtOrderCode" Text='<%#Bind("OrderCode") %>'>	</asp:Label>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                    <NetDon:FormItem HeaderText="出单日期">
                                        <ContentTemplate>
                                            <asp:Label ID="txtReceivingOrderDate" runat="server"></asp:Label>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                    <NetDon:FormItem HeaderText="发货日期">
                                        <ContentTemplate>
                                            <asp:Label ID="txtAcutalShippingDate" runat="server"></asp:Label>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                    <NetDon:FormItem HeaderText="运输计划号">
                                        <ContentTemplate>
                                            <asp:Label ID="lblTransporationPlanCode" runat="server" Text='<%#Bind("TransportationPlanCode") %>'></asp:Label>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                    <NetDon:FormItem HeaderText="交货单信息" ColumnSpan="2">
                                        <ContentTemplate>
                                            <NetDon:GridView ID="GridViewOrderDelivery" runat="server" AutoGenerateColumns="False"
                                                DataKeyNames="Id" CssClass="IncrementalTable">
                                                <Columns>
                                                    <NetDon:IndexField HeaderText="序号">
                                                    </NetDon:IndexField>
                                                    <NetDon:BoundField Visible="False" DataField="DeliveryCity">
                                                    </NetDon:BoundField>
                                                    <NetDon:TemplateField HeaderText="交货单号">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label12" Text='<%#Eval("DeliveryOrderCode") %>' runat="server"></asp:Label>
                                                            <br />
                                                        </ItemTemplate>
                                                    </NetDon:TemplateField>
                                                    <NetDon:TemplateField HeaderText="送货城市">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label13" Text='<%#Eval("DeliveryCityName") %>' runat="server"></asp:Label>
                                                            <br />
                                                        </ItemTemplate>
                                                    </NetDon:TemplateField>
                                                    <NetDon:TemplateField HeaderText="送货地址">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label14" Text='<%#Eval("DeliveryAddress") %>' runat="server"></asp:Label>
                                                            <br />
                                                        </ItemTemplate>
                                                    </NetDon:TemplateField>
                                                    <NetDon:TemplateField HeaderText="下单数量">
                                                        <ItemTemplate>
                                                            <asp:Label ID="LabelOrderQuantity" Text='<%#Convert.ToInt32(Eval("OrderQuantity")).ToString("#,###")%>'
                                                                runat="server"></asp:Label>
                                                            <br />
                                                        </ItemTemplate>
                                                    </NetDon:TemplateField>
                                                    <NetDon:TemplateField HeaderText="实际<Br/>下单数量">
                                                        <ItemTemplate>
                                                            <asp:Label ID="LabelActualEntruckingOrderQuantity" Text='<%#Convert.ToInt32(Eval("ActualEntruckingOrderQuantity")).ToString("#,###")%>'
                                                                runat="server"></asp:Label>
                                                            <br />
                                                        </ItemTemplate>
                                                    </NetDon:TemplateField>
                                                    <NetDon:TemplateField HeaderText="下单材积<Br/>（方）">
                                                        <ItemTemplate>
                                                            <asp:Label ID="LabelOrderVolumn" Text='<%#Convert.ToDecimal(Eval("OrderVolumn")).ToString("#,###.00")%>'
                                                                runat="server"></asp:Label>
                                                            <br />
                                                        </ItemTemplate>
                                                    </NetDon:TemplateField>
                                                    <NetDon:TemplateField HeaderText="下单材积<Br/>（方）">
                                                        <ItemTemplate>
                                                            <asp:Label ID="LabelActualEntruckingOrderVolumn" Text='<%#Convert.ToDecimal(Eval("ActualEntruckingOrderVolumn")).ToString("#,###.00")%>'
                                                                runat="server"></asp:Label>
                                                            <br />
                                                        </ItemTemplate>
                                                    </NetDon:TemplateField>
                                                    <NetDon:TemplateField HeaderText="下单重量<Br/>（吨）">
                                                        <ItemTemplate>
                                                            <asp:Label ID="LabelOrderWeight" Text='<%#Convert.ToDecimal(Eval("OrderWeight")).ToString("#,###.00")%>'
                                                                runat="server"></asp:Label>
                                                            <br />
                                                        </ItemTemplate>
                                                    </NetDon:TemplateField>
                                                    <NetDon:TemplateField HeaderText="下单重量<Br/>（吨）">
                                                        <ItemTemplate>
                                                            <asp:Label ID="LabelActualEntruckingOrderWeight" Text='<%#Convert.ToDecimal(Eval("ActualEntruckingOrderWeight")).ToString("#,###.00")%>'
                                                                runat="server"></asp:Label>
                                                            <br />
                                                        </ItemTemplate>
                                                    </NetDon:TemplateField>
                                                    <NetDon:TemplateField HeaderText="成本单价">
                                                        <ItemTemplate>
                                                            <asp:Label ID="LabelUnitCost" Text='<%#Convert.ToDecimal(Eval("UnitCost")).ToString("#,###.00")%>'
                                                                runat="server"></asp:Label>
                                                            <br />
                                                        </ItemTemplate>
                                                    </NetDon:TemplateField>
                                                    <NetDon:TemplateField HeaderText="营收单价">
                                                        <ItemTemplate>
                                                            <asp:Label ID="txtRevenueUnitCost" Text='<%#Convert.ToDecimal(Eval("RevenueUnitCost")).ToString("#,###.00")%>'
                                                                runat="server"></asp:Label>
                                                        </ItemTemplate>
                                                    </NetDon:TemplateField>
                                                    <NetDon:TemplateField HeaderText="装卸费率">
                                                        <ItemTemplate>
                                                            <asp:Label ID="txtGoodsUnloadingPriceRatio" Text='<%#Convert.ToDecimal(Eval("GoodsUnloadingPriceRatio")).ToString("#,###.00")%>'
                                                                runat="server"></asp:Label>
                                                        </ItemTemplate>
                                                    </NetDon:TemplateField>
                                                </Columns>
                                            </NetDon:GridView>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                      <NetDon:FormItem HeaderText="下单材积（方）">
                        <ContentTemplate>
                            <asp:Label ID="txtOrdeVolumn" runat="server" SkinID="Text80" Style="text-align: right"></asp:Label>
                        </ContentTemplate>
                    </NetDon:FormItem>
                        <NetDon:FormItem HeaderText="实际下单材积（方）">
                        <ContentTemplate>
                            <asp:Label ID="txtActualOrdeVolumn" runat="server" SkinID="Text80" Style="text-align: right"></asp:Label>
                        </ContentTemplate>
                    </NetDon:FormItem>
                    <NetDon:FormItem HeaderText="下单重量（吨）">
                        <ContentTemplate>
                            <asp:Label ID="txtOrderWeight" runat="server" SkinID="Text80" Style="text-align: right"></asp:Label>
                        </ContentTemplate>
                    </NetDon:FormItem>
                     <NetDon:FormItem HeaderText="实际下单重量（吨）">
                        <ContentTemplate>
                            <asp:Label ID="txtActualOrderWeight" runat="server" SkinID="Text80" Style="text-align: right"></asp:Label>
                        </ContentTemplate>
                    </NetDon:FormItem>
                    <NetDon:FormItem HeaderText="下单数量" >
                        <ContentTemplate>
                            <asp:Label ID="txtOrderQuantity" runat="server" SkinID="Text80" Style="text-align: right"></asp:Label>
                        </ContentTemplate>
                    </NetDon:FormItem>
                       <NetDon:FormItem HeaderText="实际下单数量">
                        <ContentTemplate>
                            <asp:Label ID="txtActualOrderQuantity" runat="server" SkinID="Text80" Style="text-align: right"></asp:Label>
                        </ContentTemplate>
                    </NetDon:FormItem>
                                    <NetDon:FormItem HeaderText="与工厂结的装卸费">
                                        <ContentTemplate>
                                            <asp:Label ID="txtUnloadingCostWithFactory" Text='<%#Convert.ToDecimal(Eval("UnloadingCostWithFactory")).ToString("#,###.00")%>'
                                                runat="server"></asp:Label>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                    <NetDon:FormItem HeaderText="实际与工厂结的装卸费">
                                        <ContentTemplate>
                                            <asp:Label ID="Label6" Text='<%#Convert.ToDecimal(Eval("ActualUnloadingCostWithFactory")).ToString("#,###.00")%>'
                                                runat="server"></asp:Label>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                    <NetDon:FormItem HeaderText="营业收入">
                                        <ContentTemplate>
                                            <asp:Label ID="txtRevenues" Text='<%#Convert.ToDecimal(Eval("Revenues")).ToString("#,###.00")%>'
                                                runat="server"></asp:Label>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                    <NetDon:FormItem HeaderText="营业收入(实际)">
                                        <ContentTemplate>
                                            <asp:Label ID="Label7" Text='<%#Convert.ToDecimal(Eval("ActualRevenues")).ToString("#,###.00")%>'
                                                runat="server"></asp:Label>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                    <NetDon:FormItem FullRow="True" HeaderVisible="False" ContentStyle-Font-Bold="true" >
                                        <ContentTemplate>
                                            <asp:Literal ID="Literal1" runat="server" Text="对账确认"></asp:Literal>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                    <NetDon:FormItem HeaderText="对账否">
                                        <ContentTemplate>
                                            <asp:CheckBox runat="server" ID="chbIsStatementOfAccount" Checked="true" />
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                    <NetDon:FormItem HeaderText="对账确认日期">
                                        <ContentTemplate>
                                            <asp:TextBox ID="txtConfirmStatementofAccountDate" Text='<%#DateTime.Now.ToString("yyyy-MM-dd")%>'
                                                runat="server"></asp:TextBox>
                                            <uc1:RequiredMark ID="RequiredMark7" runat="server" />
                                            <asp:CalendarExtender ID="CalendarExtender1" runat="server" Animated="False" Enabled="True"
                                                FirstDayOfWeek="Sunday" TargetControlID="txtConfirmStatementofAccountDate" Format="yyyy-MM-dd">
                                            </asp:CalendarExtender>
                                            <asp:CustomValidator ID="CustomValidator1" ClientValidationFunction="validateDateText"
                                                runat="server" ErrorMessage="对账确认日期无效." Display="None" ControlToValidate="txtConfirmStatementofAccountDate"
                                                OnServerValidate="DateValidator_ServerValidate"></asp:CustomValidator>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtConfirmStatementofAccountDate"
                                                Display="None" ErrorMessage="请输入对账确认日期" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                    <NetDon:FormItem HeaderText="未对账备注">
                                        <ContentTemplate>
                                            <asp:TextBox ID="txtUnConfirmStatementofAccountComments" runat="server" Text='<%#Bind("UnConfirmStatementofAccountComments") %>'
                                                Width="400px" TextMode="MultiLine" Height="100px"></asp:TextBox>
                                        </ContentTemplate>
                                    </NetDon:FormItem>
                                </Items>
                            </NetDon:FormPanel>
                        </ContentTemplate>
                    </asp:TabPanel>
                    <asp:TabPanel runat="server" ID="tabPanel2">
                        <HeaderTemplate>
                            <asp:Literal ID="Literal3" runat="server" Text="详细信息"></asp:Literal>
                        </HeaderTemplate>
                        <ContentTemplate>
                            <uc1:RevenueMachineAccountInfo runat="server" ID="RevenueMachineAccountInfoUC1" />
                        </ContentTemplate>
                    </asp:TabPanel>
                </asp:TabContainer>
            </td>
        </tr>
        <tr>
            <td style="padding-left: 150px">
                <NetDon:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="true"
                    ShowSummary="false" />
                <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="确认" />
                <asp:Button ID="btnCancel" runat="server" Text="取消" CausesValidation="false" />
                <asp:HiddenField ID="fieldIds" runat="server" />
                <asp:Button ID="btnReLoadIds" runat="server" SkinID="Hidden" OnClick="btnReLoadIds_Click"
                    CausesValidation="false" />
            </td>
        </tr>
    </table>
</asp:Content>
